﻿//<filedescription file="TaskSequenceAction_Extension.cs" company="Microsoft">
//  <copyright>
//     Copyright © Microsoft Corporation.  All rights reserved.
//     ***  DESIGNATED SAMPLE CODE (per the included software license terms) ***
//      THIS CODE SAMPLE IS MADE AVAILABLE TO YOU WITHOUT WARRANTY OF ANY KIND
//      AND CONFERS NO RIGHTS ON YOU WHATSOEVER EXCEPT THE RIGHT TO REVIEW IT
//      SOLELY AS A REFERENCE.  THE ENTIRE RISK OF USE OR RESULTS FROM USE OF
//      THIS CODE SAMPLE REMAINS WITH YOU.
//  </copyright>
//  <purpose>
//     A method that extends the custom task sequence action form to provide
//     OEM-specific functionality (branding and potentially additional features).
//  </purpose>
//  <notes>
//  </notes>
//</filedescription>
//-----------------------------------------------------------------------------

#region Using directives

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Resources;
using System.Threading;
using System.Security;
using System.Text.RegularExpressions;
using System.IO;
using System.Xml;
using System.Windows.Forms;
using Microsoft.Win32;
using Microsoft.ConfigurationManagement.AdminConsole;
using Microsoft.ConfigurationManagement.ManagementProvider;
using Microsoft.ConfigurationManagement.AdminConsole.TaskSequenceEditor;
using Microsoft.ConfigurationManagement.AdminConsole.Common;
using Microsoft.ConfigurationManagement.AdminConsole.OsdCommon;
using Microsoft.ConfigurationManagement.OemDeployment;
using Microsoft.ConfigurationManagement.IntegrationDevelopmentKit;
#endregion

namespace Microsoft.ConfigurationManagement.OemDeployment.Example
{
    /// <summary>
    /// 
    /// </summary>
    [System.ComponentModel.ToolboxItem(false)]
    public partial class GenericServerDeploymentCustomAction : Microsoft.ConfigurationManagement.OemDeployment.ServerDeploymentCustomAction
    {
        /// <summary>
        /// 
        /// </summary>
        public GenericServerDeploymentCustomAction()
        {
            //SetupCustomProperties();
            //InitializeComponent();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param taskName="oData"></param>
        public GenericServerDeploymentCustomAction(SmsPageData pageData)
            : base(pageData)
        {
            //SetupCustomProperties();
            //InitializeComponent();
        }


        #region Overridden methods for customization

        /// <summary>
        /// 
        /// </summary>
        protected override void PersonalizeForm()
        {
            this.pictureBoxOEMLogo.Image = Properties.Resources.OEMLogo;
            //this.textBoxType.Text = Properties.Resources.CTS_textBoxTypeText;
            this.textBoxFormHeader.Text = Properties.Resources.CTS_textBoxFormHeader;
            this.textBoxFormHeader.SelectAll();
            this.textBoxFormHeader.SelectionAlignment = HorizontalAlignment.Center;
        }

        /// <summary>
        /// 
        /// </summary>
        protected override void SetupCustomProperties()
        {
            BaseRegistryKey = Properties.Resources.Registry_BaseVendorRegKey;
            BaseRegistryKey64 = Properties.Resources.Registry_BaseVendorRegKey64bit;
            InitializeTraceLog(BaseRegistryKey64, Properties.Resources.LogFileName);
            OemName = Properties.Resources.OEMName;
            OemShortName = Properties.Resources.OEMShortName;
            TaskStepName = Properties.Resources.GenericServerDeploymentCustomAction;
            DeploymentWmiClassName = Properties.Resources.DeploymentWmiClassName;
            RebootWmiClassName = Properties.Resources.RebootWmiClassName;
        }

        /// <summary>
        ///     
        /// </summary>
        /// <param name="sender" type="object">
        ///     <para>
        ///         
        ///     </para>
        /// </param>
        /// <param name="e" type="System.Windows.Forms.LinkLabelLinkClickedEventArgs">
        ///     <para>
        ///         
        ///     </para>
        /// </param>
        protected override void linkSupport_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            GenericAbout aboutDialog = new GenericAbout();
            aboutDialog.Show();
        }

        
        #endregion
    }

    /// <summary>
    /// 
    /// </summary>
    [System.ComponentModel.ToolboxItem(false)]
    public partial class GenericServerDeploymentCustomActionOptions : Microsoft.ConfigurationManagement.OemDeployment.ServerDeploymentCustomActionOptions
    {
        /// <summary>
        /// GenericServerDeploymentCustomActionOptions
        /// </summary>
        public GenericServerDeploymentCustomActionOptions() : base() { }
        /// <summary>
        /// GenericServerDeploymentCustomActionOptions
        /// </summary>
        /// <param taskName="oData"></param>
        public GenericServerDeploymentCustomActionOptions(SmsPageData pageData) : base(pageData) { Title = Properties.Resources.OptionPageTitle; }
    }
}